{extend name="template/base" /}
{block name="content"}
<div class="page-container">
        <input type="hidden" name="driver_id" value="{$driver_id}">
        <table class="table table-border table-bordered table-hover table-bg mt-20">
            <thead>
            <tr class="text-c">
                <th width="25">id</th>
                <th width="">用户名</th>
                <th width="">银行卡号</th>
                <th width="">开户银行支行</th>
                <th width="">默认支付的银行卡</th>
                <th width="">添加时间</th>
                <th width="">操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="$driverBrankCard" id="dbc"}
            <tr class="text-c">
                <td>{$dbc.id}</td>
                <td>{$dbc.user_name}</td>
                <td>{$dbc.card_num}</td>
                <td>{$dbc.bank_name}</td>
                <td>
                {switch name="$dbc.default_pay"}
                    {case value="0"}不是默认支付{/case}
                    {case value="1"}是默认支付{/case}
                {/switch}
                </td>
                <td>{$dbc.create_time | date="Y-m-d H:i:s",###}</td>
                <td>
                    <a href="javascript:;" onclick="del({$dbc.id})" class="label radius" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
</div>
{/block}
{block name="script"}
<!--时间插件-->
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/template/template.js"></script>
<script>
    function del(id) {
        // var index = parent.layer.getFrameIndex(window.name)
        if (!id){
            layer.msg('缺少参数')
            return false
        }
        $.ajax({
            type: "POST",
            url: '/admin/driver/bank_card_info',
            data: { id: id},
            success: function (result) {
                if (result.code){
                    layer.msg(result.msg)
                } else{
                    layer.msg(result.msg)
                    location.reload()
                }
            },
            error: function () {
                layer.msg('错误')
            }
        })
    }
</script>
{/block}
